package com.jeesite.modules.kj.api.controller.activity;

import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.config.Global;
import com.jeesite.common.entity.Page;
import com.jeesite.modules.common.interfaces.CurrentUser;
import com.jeesite.modules.common.interfaces.UserLoginToken;
import com.jeesite.modules.kj.api.vo.DataListPageVo;
import com.jeesite.modules.kj.api.vo.response.ActivityJobResponseVo;
import com.jeesite.modules.kj.api.vo.response.ActivityPhaseResponseVo;
import com.jeesite.modules.kj.api.vo.response.MemberJobResponseVo;
import com.jeesite.modules.kj.api.vo.responseVo.ResponseBean;
import com.jeesite.modules.kj.entity.KjActivityJob;
import com.jeesite.modules.kj.entity.KjActivityPhase;
import com.jeesite.modules.kj.entity.KjMember;
import com.jeesite.modules.kj.entity.KjMemberJob;
import com.jeesite.modules.kj.service.KjActivityJobService;
import com.jeesite.modules.kj.service.KjActivityPhaseService;
import com.jeesite.modules.kj.service.KjActivityService;
import com.jeesite.modules.kj.service.KjMemberJobService;
import com.jeesite.modules.kj.utils.KjMemberUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

/**
 * Author:hzy
 * Date:2021/07/04
 * Description:
 */
@Api(value = "活动阶段api", tags = {"活动阶段api"})
@Slf4j
@Controller
@RequestMapping(value = "/api/activityPhase")
public class ActivityPhaseApiController {
    private final static Logger logger = LoggerFactory.getLogger(ActivityPhaseApiController.class);

    @Autowired
    KjActivityService kjActivityService;

    @Autowired
    KjActivityPhaseService kjActivityPhaseService;


    @ApiOperation(value = "获取活动的阶段列表", notes = "获取活动的阶段列表")
    @GetMapping(value = "list")
    public ResponseBean<List<ActivityPhaseResponseVo>> list(String activityId) {
        KjActivityPhase where = new KjActivityPhase();
        where.setActivityId(activityId);
        List<KjActivityPhase> dataList = kjActivityPhaseService.findList(where);
        List<ActivityPhaseResponseVo> vos = ListUtils.newArrayList();
        for (KjActivityPhase activityPhase: dataList
        ) {
            vos.add(new ActivityPhaseResponseVo(activityPhase));
        }
        return new ResponseBean<>(vos);
    }


}
